home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / file-tra / ftp-rl.taz / ftp-rl / ftp / ftp.rl.diff < prev    next >
Encoding:
Text File  |  1992-10-07  |  7.1 KB  |  266 lines

  1. *** /dev/null    Sun Nov 18 23:51:43 1990
  2. --- Makefile    Mon Nov 19 00:13:34 1990
  3. ***************
  4. *** 0 ****
  5. --- 1,19 ----
  6. + #    @(#)Makefile    5.11 (Berkeley) 5/11/90
  7. + # heavily modified.... by wollman@emily.uvm.edu
  8. + PROG=    ftp
  9. + SRCS=    cmds.c cmdtab.c ftp.c glob.c main.c ruserpass.c domacro.c
  10. + #.include <bsd.prog.mk>
  11. + OBJS=    cmds.o cmdtab.o ftp.o glob.o main.o ruserpass.o domacro.o
  12. + LIBS=    -lreadline -lresolv -ltermcap
  13. + .c.o:
  14. +     gcc -traditional -g -I./ -I../include -o $*.o -c $*.c
  15. + ftp    :    $(OBJS)
  16. +     gcc -o ftp $(OBJS) -L$(HOME)/lib -lreadline -lresolv -ltermcap
  17. + $(OBJS)    :    ftp_var.h
  18. *** ftp.c.orig    Sun Nov 18 21:21:49 1990
  19. --- ftp.c    Sun Nov 18 23:31:13 1990
  20. ***************
  21. *** 83,89 ****
  22.               return((char *) 0);
  23.           }
  24.           hisctladdr.sin_family = hp->h_addrtype;
  25. !         bcopy(hp->h_addr_list[0],
  26.               (caddr_t)&hisctladdr.sin_addr, hp->h_length);
  27.           (void) strncpy(hostnamebuf, hp->h_name, sizeof(hostnamebuf));
  28.       }
  29. --- 83,89 ----
  30.               return((char *) 0);
  31.           }
  32.           hisctladdr.sin_family = hp->h_addrtype;
  33. !         bcopy(hp->h_addr,
  34.               (caddr_t)&hisctladdr.sin_addr, hp->h_length);
  35.           (void) strncpy(hostnamebuf, hp->h_name, sizeof(hostnamebuf));
  36.       }
  37. ***************
  38. *** 96,102 ****
  39.       }
  40.       hisctladdr.sin_port = port;
  41.       while (connect(s, (struct sockaddr *)&hisctladdr, sizeof (hisctladdr)) < 0) {
  42. !         if (hp && hp->h_addr_list[1]) {
  43.               int oerrno = errno;
  44.               extern char *inet_ntoa();
  45.   
  46. --- 96,102 ----
  47.       }
  48.       hisctladdr.sin_port = port;
  49.       while (connect(s, (struct sockaddr *)&hisctladdr, sizeof (hisctladdr)) < 0) {
  50. !         if (hp && 0 /*hp->h_addr_list[1]*/) {
  51.               int oerrno = errno;
  52.               extern char *inet_ntoa();
  53.   
  54. ***************
  55. *** 104,111 ****
  56.                   inet_ntoa(hisctladdr.sin_addr));
  57.               errno = oerrno;
  58.               perror((char *) 0);
  59. !             hp->h_addr_list++;
  60. !             bcopy(hp->h_addr_list[0],
  61.                    (caddr_t)&hisctladdr.sin_addr, hp->h_length);
  62.               fprintf(stdout, "Trying %s...\n",
  63.                   inet_ntoa(hisctladdr.sin_addr));
  64. --- 104,116 ----
  65.                   inet_ntoa(hisctladdr.sin_addr));
  66.               errno = oerrno;
  67.               perror((char *) 0);
  68. !             /*hp->h_addr_list++;*/
  69. !             /* This can't work because we don't have an
  70. !              * h_addr_list in our struct hostent.
  71. !              * Actually, maybe we do, but <netdb.h> doesn't
  72. !              * show it.
  73. !              */
  74. !             bcopy(hp->h_addr,
  75.                    (caddr_t)&hisctladdr.sin_addr, hp->h_length);
  76.               fprintf(stdout, "Trying %s...\n",
  77.                   inet_ntoa(hisctladdr.sin_addr));
  78. *** /dev/null    Sun Nov 18 23:51:43 1990
  79. --- paths.h    Sun Nov 18 22:56:51 1990
  80. ***************
  81. *** 0 ****
  82. --- 1,38 ----
  83. + /*
  84. +  * Copyright (c) 1989 The Regents of the University of California.
  85. +  * All rights reserved.
  86. +  *
  87. +  * Redistribution and use in source and binary forms are permitted provided
  88. +  * that: (1) source distributions retain this entire copyright notice and
  89. +  * comment, and (2) distributions including binaries display the following
  90. +  * acknowledgement:  ``This product includes software developed by the
  91. +  * University of California, Berkeley and its contributors'' in the
  92. +  * documentation or other materials provided with the distribution and in
  93. +  * all advertising materials mentioning features or use of this software.
  94. +  * Neither the name of the University nor the names of its contributors may
  95. +  * be used to endorse or promote products derived from this software without
  96. +  * specific prior written permission.
  97. +  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  98. +  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  99. +  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  100. +  *
  101. +  *    @(#)paths.h    5.7 (Berkeley) 6/24/90
  102. +  */
  103. + #define    _PATH_BSHELL    "/bin/sh"
  104. + #define    _PATH_CONSOLE    "/dev/console"
  105. + #define    _PATH_CSHELL    "/bin/csh"
  106. + #define    _PATH_DEV    "/dev/"
  107. + #define    _PATH_DEVNULL    "/dev/null"
  108. + #define    _PATH_DRUM    "/dev/drum"
  109. + #define    _PATH_KMEM    "/dev/kmem"
  110. + #define    _PATH_MAILDIR    "/var/mail"
  111. + #define    _PATH_MAN    "/usr/man"
  112. + #define    _PATH_MEM    "/dev/mem"
  113. + #define    _PATH_NOLOGIN    "/etc/nologin"
  114. + #define    _PATH_SENDMAIL    "/usr/sbin/sendmail"
  115. + #define    _PATH_TMP    "/tmp/"
  116. + #define    _PATH_TTY    "/dev/tty"
  117. + #define    _PATH_UNIX    "/vmunix"
  118. + #define    _PATH_VARTMP    "/var/tmp"
  119. + #define    _PATH_VI    "/usr/bin/vi"
  120. *** main.c.orig    Mon Nov 19 00:38:13 1990
  121. --- main.c    Mon Nov 19 00:37:56 1990
  122. ***************
  123. *** 28,33 ****
  124. --- 28,57 ----
  125.   #endif /* not lint */
  126.   
  127.   /*
  128. +  * This version of FTP has been modified to interface with the GNU
  129. +  * readline and history libraries.  The following RCS information is
  130. +  * provided for interested readers.   - wollman@emily.uvm.edu
  131. +  */
  132. + #ifndef lint
  133. + static char rcsid[] = "$Header: /home/emily1/others/wollman/src/ftp/RCS/main.c,v 5.19 90/11/19 00:21:25 wollman Exp Locker: wollman $";
  134. + #endif
  135. + /*
  136. +  * $Log:    main.c,v $
  137. +  * Revision 5.19  90/11/19  00:21:25  wollman
  138. +  * Corrected small bug reading input...
  139. +  * 
  140. +  * Revision 5.18  90/11/19  00:05:44  wollman
  141. +  * Added initial support for readline.  There is a disgusting hack in here.
  142. +  * No support for completion as yet, but we do have history.
  143. +  * 
  144. +  * Revision 5.17  90/11/18  23:46:24  wollman
  145. +  * Added information about nature and purpose of modifications for future
  146. +  * reference.
  147. +  * 
  148. +  */
  149. + /*
  150.    * FTP User Program -- Command Interface.
  151.    */
  152.   #include "ftp_var.h"
  153. ***************
  154. *** 43,48 ****
  155. --- 67,74 ----
  156.   #include <ctype.h>
  157.   #include <netdb.h>
  158.   #include <pwd.h>
  159. + #include <readline/readline.h>
  160. + #include <readline/history.h>
  161.   
  162.   uid_t    getuid();
  163.   sig_t    intr();
  164. ***************
  165. *** 206,224 ****
  166.       register struct cmd *c;
  167.       struct cmd *getcmd();
  168.       extern int help();
  169.   
  170.       if (!top)
  171.           (void) putchar('\n');
  172.       for (;;) {
  173.           if (fromatty) {
  174.               printf("ftp> ");
  175.               (void) fflush(stdout);
  176.           }
  177. !         if (gets(line) == 0) {
  178. !             if (feof(stdin) || ferror(stdin))
  179.                   quit();
  180. !             break;
  181.           }
  182.           if (line[0] == 0)
  183.               break;
  184.           makeargv();
  185. --- 232,274 ----
  186.       register struct cmd *c;
  187.       struct cmd *getcmd();
  188.       extern int help();
  189. +     char *lineread;
  190.   
  191.       if (!top)
  192.           (void) putchar('\n');
  193.       for (;;) {
  194. + #ifdef notdef
  195.           if (fromatty) {
  196.               printf("ftp> ");
  197.               (void) fflush(stdout);
  198.           }
  199. ! #else
  200. !         if (fromatty) {
  201. !             lineread = readline("ftp> ");
  202. !         }
  203. ! #endif
  204. !         if (!fromatty) {
  205. !             if (gets(line) == 0) {
  206. !                 if (feof(stdin) || ferror(stdin))
  207. !                   quit();
  208. !                 break;
  209. !             }
  210. !         } else {
  211. !             if (!lineread) {
  212.                   quit();
  213. !                 break;
  214. !             }
  215. !             /*
  216. !              * This is a really ugly hack forced upon us
  217. !              * because of the fact that line[] is global and
  218. !              * other functions depend on it.  If I find the
  219. !              * time, I will fix this.
  220. !              */
  221. !             strcpy(line,lineread);
  222. !             if(lineread[0]) add_history(lineread);
  223. !             free(lineread);
  224.           }
  225.           if (line[0] == 0)
  226.               break;
  227.           makeargv();
  228. *** /dev/null    Sun Nov 18 23:51:43 1990
  229. --- compat.h    Sun Nov 18 23:14:17 1990
  230. ***************
  231. *** 0 ****
  232. --- 1,5 ----
  233. + /*
  234. +  * Compatibility routines for 4.3-reno ftp on Encore Multimax
  235. +  */
  236. + typedef int (*sig_t)();
  237. *** ftp_var.h.orig    Sun Nov 18 21:21:52 1990
  238. --- ftp_var.h    Sun Nov 18 23:14:14 1990
  239. ***************
  240. *** 20,25 ****
  241. --- 20,31 ----
  242.    */
  243.   
  244.   /*
  245. +  * Include some definitions to massage the differences betweem 4.3-reno
  246. +  * and Umax.
  247. +  */
  248. + #include "compat.h"
  249. + /*
  250.    * FTP global variables.
  251.    */
  252.   
  253.